from django.contrib.syndication.feeds import Feed
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings

from main.models import *

# FEEDS
class LatestEntries(Feed):
    author = settings.NIGHTLY['name']
    title = "Nightly versions of %s" % settings.NIGHTLY['project_name']
    link = "/feed/latest/"
    description = "latest updates to %s" % settings.NIGHTLY['project_name']

    def items(self):
        return Snapshot.objects.order_by('-snapshot_time')[:15]
